package com.white.bean;

import com.baomidou.mybatisplus.annotation.TableId;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * -- 搜索历史表：搜索历史ID、用户ID、搜索内容
 * create table searchHistory(
 * searchHistoryId int primary key AUTO_INCREMENT comment "搜索历史ID",
 * userId int comment "用户ID",
 * foreign key(userId) REFERENCES user(userId) on delete cascade on update cascade,
 * content varchar(255) comment "搜索内容"
 * );
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class SearchHistory {
    @TableId("searchHistoryId")
    private Long searchHistoryId;
    private Long userId;
    private String content, createTime;

    public SearchHistory(Long userId, String content) {
        this.userId = userId;
        this.content = content;
    }
}
